package com.yjhb.android.sbz.activity.rule

import com.bumptech.glide.Glide
import com.yjhb.android.sbz.R
import com.yjhb.android.sbz.activity.BaseActivity
import com.jojo.android.zxlib.base.mvp.BasePresenter
import com.jojo.android.zxlib.view.preview.PreviewBuilder
import com.jojo.android.zxlib.view.preview.enitity.ImageViewInfo
import kotlinx.android.synthetic.main.activity_rule_punishment.*


/**
 *  创建者 zx
 *  创建时间 2021/3/30 16:58
 */
class RulePunishmentActivity : BaseActivity<BasePresenter<*, *>?>() {


    override fun initPresenter(): BasePresenter<*, *>? {
        return null
    }

    override fun getLayoutId(): Int {
        return R.layout.activity_rule_punishment
    }

    override fun initUI() {
        Glide.with(this).load(RuleImg.rulesImgUrl).into(rules_iv)
    }

    override fun initData() {
    }

    override fun regEvent() {
        rules_iv.setOnClickListener {
            val info = ImageViewInfo(RuleImg.rulesImgUrl)
            it.getGlobalVisibleRect(info.bounds)
            PreviewBuilder.from(this)
                    .setCurrentIndex(0)
                    .setImg(info)
                    .setDrag(false)
                    .start()
        }
        back?.setOnClickListener { finish() }
    }
}